Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-cli): import routing module with forRoot #16438

Merged
merged 1 commit into from
May 15, 2017
Merged

fix(compiler-cli): import routing module with forRoot #16438

merged 1 commit into from
May 15, 2017

Conversation

Adol1111
Copy link
Contributor

What kind of change does this PR introduce? (check one with "x")

[*] Bugfix

What is the current behavior? (You can also link to an open issue here)
if use forRoot with AppRoutingModule like this, it can't generate lazy routes chunks when building:

@NgModule({
  imports: [
    BrowserModule,
    AppRoutingModule.forRoot()
  ],
  declarations: [AppComponent],
  bootstrap: [AppComponent]
})
export class AppModule {
}

What is the new behavior?

Does this PR introduce a breaking change? (check one with "x")

[*] No

@jasonaden jasonaden requested a review from tbosch May 10, 2017 20:29
@jasonaden jasonaden added the area: core Issues related to the framework runtime label May 10, 2017
Copy link
Contributor

@tbosch tbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please squash the commits into one.

@Adol1111
Copy link
Contributor Author

@tbosch Squashed.

@tbosch tbosch added the action: merge The PR is ready for merge by the caretaker label May 12, 2017
@jasonaden jasonaden merged commit 1eba623 into angular:master May 15, 2017
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
@uvconnects
Copy link

Did not work. this is the error I have below when using npm build --prod or ng build --aot angular 5

import { Routes, RouterModule, CanActivate, Router } from '@angular/router'; NgModule({ imports: [RouterModule.forRoot(appRoutes)], exports: [RouterModule] }) export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
ERROR in Error: Could not resolve module ../column-b-table/btable.module relative to /src/app/app.module.ts at StaticSymbolResolver.getSymbolByModule (\node_modules\@angular\compiler\bundles\compiler.umd.js:31826:30) at StaticReflector.resolveExternalReference (\node_modules\@angular\compiler\bundles\compiler.umd.js:30292:62) at parseLazyRoute (\node_modules\@angular\compiler\bundles\compiler.umd.js:28577:55) at listLazyRoutes (\node_modules\@angular\compiler\bundles\compiler.umd.js:28539:36) at visitLazyRoute (\node_modules\@angular\compiler\bundles\compiler.umd.js:29937:47) at AotCompiler.listLazyRoutes (\node_modules\@angular\compiler\bundles\compiler.umd.js:29905:20) at AngularCompilerProgram.listLazyRoutes (\node_modules\@angular\compiler-cli\src\transformers\program.js:157:30) at Function.NgTools_InternalApi_NG_2.listLazyRoutes (\NportWeb\node_modules\@angular\compiler-cli\src\ngtools_api.js:44:36) at AngularCompilerPlugin._getLazyRoutesFromNgtools (NportWeb\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:246:66) at Promise.resolve.then.then (\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:542:50)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants